#define GLFW_INCLUDE_NONE
#include "pch.h"
#include "GLContext.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
namespace HS {


	GLContext::GLContext(GLFWwindow* handle) : mWindowHandle(handle) { 
		if (handle == nullptr) {
			LOGERROR("Window Handle is NULL!");
		}
	}

	GLContext::~GLContext() {

	}

	void GLContext::Init() {
		glfwMakeContextCurrent(mWindowHandle);
		int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
		if (!status)
		{
			LOGERROR("Failed to initialize GLAD!");
		}
	}

	void GLContext::SwapBuffer() {
		glfwSwapBuffers(mWindowHandle);
	}

}
